Left Termination of the query pattern perm_in_2(g, a) w.r.t. the given Prolog program could not be shown:



Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof

Clauses:

ap1(nil, X, X).
ap1(cons(H, X), Y, cons(H, Z)) :- ap1(X, Y, Z).
ap2(nil, X, X).
ap2(cons(H, X), Y, cons(H, Z)) :- ap2(X, Y, Z).
perm(nil, nil).
perm(Xs, cons(X, Ys)) :- ','(ap1(X1s, cons(X, X2s), Xs), ','(ap2(X1s, X2s, Zs), perm(Zs, Ys))).

Queries:

perm(g,a).

We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
perm_in: (b,f) (f,f)
ap1_in: (f,b,b) (f,b,f)
ap2_in: (b,f,f) (f,f,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

perm_in_ga(nil, nil) → perm_out_ga(nil, nil)
perm_in_ga(Xs, cons(X, Ys)) → U3_ga(Xs, X, Ys, ap1_in_agg(X1s, cons(X, X2s), Xs))
ap1_in_agg(nil, X, X) → ap1_out_agg(nil, X, X)
ap1_in_agg(cons(H, X), Y, cons(H, Z)) → U1_agg(H, X, Y, Z, ap1_in_aga(X, Y, Z))
ap1_in_aga(nil, X, X) → ap1_out_aga(nil, X, X)
ap1_in_aga(cons(H, X), Y, cons(H, Z)) → U1_aga(H, X, Y, Z, ap1_in_aga(X, Y, Z))
U1_aga(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons(H, X), Y, cons(H, Z))
U1_agg(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_agg(cons(H, X), Y, cons(H, Z))
U3_ga(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → U4_ga(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
ap2_in_gaa(nil, X, X) → ap2_out_gaa(nil, X, X)
ap2_in_gaa(cons(H, X), Y, cons(H, Z)) → U2_gaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
ap2_in_aaa(nil, X, X) → ap2_out_aaa(nil, X, X)
ap2_in_aaa(cons(H, X), Y, cons(H, Z)) → U2_aaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
U2_aaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_aaa(cons(H, X), Y, cons(H, Z))
U2_gaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_gaa(cons(H, X), Y, cons(H, Z))
U4_ga(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_ga(Xs, X, Ys, perm_in_aa(Zs, Ys))
perm_in_aa(nil, nil) → perm_out_aa(nil, nil)
perm_in_aa(Xs, cons(X, Ys)) → U3_aa(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))
U3_aa(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_aa(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U4_aa(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_aa(Xs, X, Ys, perm_in_aa(Zs, Ys))
U5_aa(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_aa(Xs, cons(X, Ys))
U5_ga(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_ga(Xs, cons(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in_ga(x1, x2)  =  perm_in_ga(x1)
nil  =  nil
perm_out_ga(x1, x2)  =  perm_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x4)
ap1_in_agg(x1, x2, x3)  =  ap1_in_agg(x2, x3)
cons(x1, x2)  =  cons
ap1_out_agg(x1, x2, x3)  =  ap1_out_agg(x1)
U1_agg(x1, x2, x3, x4, x5)  =  U1_agg(x5)
ap1_in_aga(x1, x2, x3)  =  ap1_in_aga(x2)
ap1_out_aga(x1, x2, x3)  =  ap1_out_aga(x1, x3)
U1_aga(x1, x2, x3, x4, x5)  =  U1_aga(x5)
U4_ga(x1, x2, x3, x4, x5, x6)  =  U4_ga(x6)
ap2_in_gaa(x1, x2, x3)  =  ap2_in_gaa(x1)
ap2_out_gaa(x1, x2, x3)  =  ap2_out_gaa
U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)
ap2_in_aaa(x1, x2, x3)  =  ap2_in_aaa
ap2_out_aaa(x1, x2, x3)  =  ap2_out_aaa(x1)
U2_aaa(x1, x2, x3, x4, x5)  =  U2_aaa(x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5, x6)  =  U4_aa(x1, x6)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x1, x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof
  ↳ PrologToPiTRSProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

perm_in_ga(nil, nil) → perm_out_ga(nil, nil)
perm_in_ga(Xs, cons(X, Ys)) → U3_ga(Xs, X, Ys, ap1_in_agg(X1s, cons(X, X2s), Xs))
ap1_in_agg(nil, X, X) → ap1_out_agg(nil, X, X)
ap1_in_agg(cons(H, X), Y, cons(H, Z)) → U1_agg(H, X, Y, Z, ap1_in_aga(X, Y, Z))
ap1_in_aga(nil, X, X) → ap1_out_aga(nil, X, X)
ap1_in_aga(cons(H, X), Y, cons(H, Z)) → U1_aga(H, X, Y, Z, ap1_in_aga(X, Y, Z))
U1_aga(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons(H, X), Y, cons(H, Z))
U1_agg(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_agg(cons(H, X), Y, cons(H, Z))
U3_ga(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → U4_ga(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
ap2_in_gaa(nil, X, X) → ap2_out_gaa(nil, X, X)
ap2_in_gaa(cons(H, X), Y, cons(H, Z)) → U2_gaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
ap2_in_aaa(nil, X, X) → ap2_out_aaa(nil, X, X)
ap2_in_aaa(cons(H, X), Y, cons(H, Z)) → U2_aaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
U2_aaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_aaa(cons(H, X), Y, cons(H, Z))
U2_gaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_gaa(cons(H, X), Y, cons(H, Z))
U4_ga(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_ga(Xs, X, Ys, perm_in_aa(Zs, Ys))
perm_in_aa(nil, nil) → perm_out_aa(nil, nil)
perm_in_aa(Xs, cons(X, Ys)) → U3_aa(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))
U3_aa(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_aa(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U4_aa(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_aa(Xs, X, Ys, perm_in_aa(Zs, Ys))
U5_aa(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_aa(Xs, cons(X, Ys))
U5_ga(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_ga(Xs, cons(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in_ga(x1, x2)  =  perm_in_ga(x1)
nil  =  nil
perm_out_ga(x1, x2)  =  perm_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x4)
ap1_in_agg(x1, x2, x3)  =  ap1_in_agg(x2, x3)
cons(x1, x2)  =  cons
ap1_out_agg(x1, x2, x3)  =  ap1_out_agg(x1)
U1_agg(x1, x2, x3, x4, x5)  =  U1_agg(x5)
ap1_in_aga(x1, x2, x3)  =  ap1_in_aga(x2)
ap1_out_aga(x1, x2, x3)  =  ap1_out_aga(x1, x3)
U1_aga(x1, x2, x3, x4, x5)  =  U1_aga(x5)
U4_ga(x1, x2, x3, x4, x5, x6)  =  U4_ga(x6)
ap2_in_gaa(x1, x2, x3)  =  ap2_in_gaa(x1)
ap2_out_gaa(x1, x2, x3)  =  ap2_out_gaa
U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)
ap2_in_aaa(x1, x2, x3)  =  ap2_in_aaa
ap2_out_aaa(x1, x2, x3)  =  ap2_out_aaa(x1)
U2_aaa(x1, x2, x3, x4, x5)  =  U2_aaa(x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5, x6)  =  U4_aa(x1, x6)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x1, x4)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

PERM_IN_GA(Xs, cons(X, Ys)) → U3_GA(Xs, X, Ys, ap1_in_agg(X1s, cons(X, X2s), Xs))
PERM_IN_GA(Xs, cons(X, Ys)) → AP1_IN_AGG(X1s, cons(X, X2s), Xs)
AP1_IN_AGG(cons(H, X), Y, cons(H, Z)) → U1_AGG(H, X, Y, Z, ap1_in_aga(X, Y, Z))
AP1_IN_AGG(cons(H, X), Y, cons(H, Z)) → AP1_IN_AGA(X, Y, Z)
AP1_IN_AGA(cons(H, X), Y, cons(H, Z)) → U1_AGA(H, X, Y, Z, ap1_in_aga(X, Y, Z))
AP1_IN_AGA(cons(H, X), Y, cons(H, Z)) → AP1_IN_AGA(X, Y, Z)
U3_GA(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → U4_GA(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U3_GA(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → AP2_IN_GAA(X1s, X2s, Zs)
AP2_IN_GAA(cons(H, X), Y, cons(H, Z)) → U2_GAA(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
AP2_IN_GAA(cons(H, X), Y, cons(H, Z)) → AP2_IN_AAA(X, Y, Z)
AP2_IN_AAA(cons(H, X), Y, cons(H, Z)) → U2_AAA(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
AP2_IN_AAA(cons(H, X), Y, cons(H, Z)) → AP2_IN_AAA(X, Y, Z)
U4_GA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_GA(Xs, X, Ys, perm_in_aa(Zs, Ys))
U4_GA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → PERM_IN_AA(Zs, Ys)
PERM_IN_AA(Xs, cons(X, Ys)) → U3_AA(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))
PERM_IN_AA(Xs, cons(X, Ys)) → AP1_IN_AGA(X1s, cons(X, X2s), Xs)
U3_AA(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_AA(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U3_AA(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → AP2_IN_GAA(X1s, X2s, Zs)
U4_AA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_AA(Xs, X, Ys, perm_in_aa(Zs, Ys))
U4_AA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → PERM_IN_AA(Zs, Ys)

The TRS R consists of the following rules:

perm_in_ga(nil, nil) → perm_out_ga(nil, nil)
perm_in_ga(Xs, cons(X, Ys)) → U3_ga(Xs, X, Ys, ap1_in_agg(X1s, cons(X, X2s), Xs))
ap1_in_agg(nil, X, X) → ap1_out_agg(nil, X, X)
ap1_in_agg(cons(H, X), Y, cons(H, Z)) → U1_agg(H, X, Y, Z, ap1_in_aga(X, Y, Z))
ap1_in_aga(nil, X, X) → ap1_out_aga(nil, X, X)
ap1_in_aga(cons(H, X), Y, cons(H, Z)) → U1_aga(H, X, Y, Z, ap1_in_aga(X, Y, Z))
U1_aga(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons(H, X), Y, cons(H, Z))
U1_agg(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_agg(cons(H, X), Y, cons(H, Z))
U3_ga(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → U4_ga(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
ap2_in_gaa(nil, X, X) → ap2_out_gaa(nil, X, X)
ap2_in_gaa(cons(H, X), Y, cons(H, Z)) → U2_gaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
ap2_in_aaa(nil, X, X) → ap2_out_aaa(nil, X, X)
ap2_in_aaa(cons(H, X), Y, cons(H, Z)) → U2_aaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
U2_aaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_aaa(cons(H, X), Y, cons(H, Z))
U2_gaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_gaa(cons(H, X), Y, cons(H, Z))
U4_ga(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_ga(Xs, X, Ys, perm_in_aa(Zs, Ys))
perm_in_aa(nil, nil) → perm_out_aa(nil, nil)
perm_in_aa(Xs, cons(X, Ys)) → U3_aa(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))
U3_aa(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_aa(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U4_aa(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_aa(Xs, X, Ys, perm_in_aa(Zs, Ys))
U5_aa(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_aa(Xs, cons(X, Ys))
U5_ga(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_ga(Xs, cons(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in_ga(x1, x2)  =  perm_in_ga(x1)
nil  =  nil
perm_out_ga(x1, x2)  =  perm_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x4)
ap1_in_agg(x1, x2, x3)  =  ap1_in_agg(x2, x3)
cons(x1, x2)  =  cons
ap1_out_agg(x1, x2, x3)  =  ap1_out_agg(x1)
U1_agg(x1, x2, x3, x4, x5)  =  U1_agg(x5)
ap1_in_aga(x1, x2, x3)  =  ap1_in_aga(x2)
ap1_out_aga(x1, x2, x3)  =  ap1_out_aga(x1, x3)
U1_aga(x1, x2, x3, x4, x5)  =  U1_aga(x5)
U4_ga(x1, x2, x3, x4, x5, x6)  =  U4_ga(x6)
ap2_in_gaa(x1, x2, x3)  =  ap2_in_gaa(x1)
ap2_out_gaa(x1, x2, x3)  =  ap2_out_gaa
U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)
ap2_in_aaa(x1, x2, x3)  =  ap2_in_aaa
ap2_out_aaa(x1, x2, x3)  =  ap2_out_aaa(x1)
U2_aaa(x1, x2, x3, x4, x5)  =  U2_aaa(x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5, x6)  =  U4_aa(x1, x6)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x1, x4)
AP1_IN_AGA(x1, x2, x3)  =  AP1_IN_AGA(x2)
U5_AA(x1, x2, x3, x4)  =  U5_AA(x1, x4)
U2_GAA(x1, x2, x3, x4, x5)  =  U2_GAA(x5)
U4_AA(x1, x2, x3, x4, x5, x6)  =  U4_AA(x1, x6)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x4)
U5_GA(x1, x2, x3, x4)  =  U5_GA(x4)
U2_AAA(x1, x2, x3, x4, x5)  =  U2_AAA(x5)
AP1_IN_AGG(x1, x2, x3)  =  AP1_IN_AGG(x2, x3)
AP2_IN_GAA(x1, x2, x3)  =  AP2_IN_GAA(x1)
U4_GA(x1, x2, x3, x4, x5, x6)  =  U4_GA(x6)
PERM_IN_AA(x1, x2)  =  PERM_IN_AA
AP2_IN_AAA(x1, x2, x3)  =  AP2_IN_AAA
PERM_IN_GA(x1, x2)  =  PERM_IN_GA(x1)
U1_AGG(x1, x2, x3, x4, x5)  =  U1_AGG(x5)
U1_AGA(x1, x2, x3, x4, x5)  =  U1_AGA(x5)
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

PERM_IN_GA(Xs, cons(X, Ys)) → U3_GA(Xs, X, Ys, ap1_in_agg(X1s, cons(X, X2s), Xs))
PERM_IN_GA(Xs, cons(X, Ys)) → AP1_IN_AGG(X1s, cons(X, X2s), Xs)
AP1_IN_AGG(cons(H, X), Y, cons(H, Z)) → U1_AGG(H, X, Y, Z, ap1_in_aga(X, Y, Z))
AP1_IN_AGG(cons(H, X), Y, cons(H, Z)) → AP1_IN_AGA(X, Y, Z)
AP1_IN_AGA(cons(H, X), Y, cons(H, Z)) → U1_AGA(H, X, Y, Z, ap1_in_aga(X, Y, Z))
AP1_IN_AGA(cons(H, X), Y, cons(H, Z)) → AP1_IN_AGA(X, Y, Z)
U3_GA(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → U4_GA(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U3_GA(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → AP2_IN_GAA(X1s, X2s, Zs)
AP2_IN_GAA(cons(H, X), Y, cons(H, Z)) → U2_GAA(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
AP2_IN_GAA(cons(H, X), Y, cons(H, Z)) → AP2_IN_AAA(X, Y, Z)
AP2_IN_AAA(cons(H, X), Y, cons(H, Z)) → U2_AAA(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
AP2_IN_AAA(cons(H, X), Y, cons(H, Z)) → AP2_IN_AAA(X, Y, Z)
U4_GA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_GA(Xs, X, Ys, perm_in_aa(Zs, Ys))
U4_GA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → PERM_IN_AA(Zs, Ys)
PERM_IN_AA(Xs, cons(X, Ys)) → U3_AA(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))
PERM_IN_AA(Xs, cons(X, Ys)) → AP1_IN_AGA(X1s, cons(X, X2s), Xs)
U3_AA(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_AA(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U3_AA(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → AP2_IN_GAA(X1s, X2s, Zs)
U4_AA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_AA(Xs, X, Ys, perm_in_aa(Zs, Ys))
U4_AA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → PERM_IN_AA(Zs, Ys)

The TRS R consists of the following rules:

perm_in_ga(nil, nil) → perm_out_ga(nil, nil)
perm_in_ga(Xs, cons(X, Ys)) → U3_ga(Xs, X, Ys, ap1_in_agg(X1s, cons(X, X2s), Xs))
ap1_in_agg(nil, X, X) → ap1_out_agg(nil, X, X)
ap1_in_agg(cons(H, X), Y, cons(H, Z)) → U1_agg(H, X, Y, Z, ap1_in_aga(X, Y, Z))
ap1_in_aga(nil, X, X) → ap1_out_aga(nil, X, X)
ap1_in_aga(cons(H, X), Y, cons(H, Z)) → U1_aga(H, X, Y, Z, ap1_in_aga(X, Y, Z))
U1_aga(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons(H, X), Y, cons(H, Z))
U1_agg(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_agg(cons(H, X), Y, cons(H, Z))
U3_ga(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → U4_ga(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
ap2_in_gaa(nil, X, X) → ap2_out_gaa(nil, X, X)
ap2_in_gaa(cons(H, X), Y, cons(H, Z)) → U2_gaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
ap2_in_aaa(nil, X, X) → ap2_out_aaa(nil, X, X)
ap2_in_aaa(cons(H, X), Y, cons(H, Z)) → U2_aaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
U2_aaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_aaa(cons(H, X), Y, cons(H, Z))
U2_gaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_gaa(cons(H, X), Y, cons(H, Z))
U4_ga(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_ga(Xs, X, Ys, perm_in_aa(Zs, Ys))
perm_in_aa(nil, nil) → perm_out_aa(nil, nil)
perm_in_aa(Xs, cons(X, Ys)) → U3_aa(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))
U3_aa(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_aa(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U4_aa(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_aa(Xs, X, Ys, perm_in_aa(Zs, Ys))
U5_aa(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_aa(Xs, cons(X, Ys))
U5_ga(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_ga(Xs, cons(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in_ga(x1, x2)  =  perm_in_ga(x1)
nil  =  nil
perm_out_ga(x1, x2)  =  perm_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x4)
ap1_in_agg(x1, x2, x3)  =  ap1_in_agg(x2, x3)
cons(x1, x2)  =  cons
ap1_out_agg(x1, x2, x3)  =  ap1_out_agg(x1)
U1_agg(x1, x2, x3, x4, x5)  =  U1_agg(x5)
ap1_in_aga(x1, x2, x3)  =  ap1_in_aga(x2)
ap1_out_aga(x1, x2, x3)  =  ap1_out_aga(x1, x3)
U1_aga(x1, x2, x3, x4, x5)  =  U1_aga(x5)
U4_ga(x1, x2, x3, x4, x5, x6)  =  U4_ga(x6)
ap2_in_gaa(x1, x2, x3)  =  ap2_in_gaa(x1)
ap2_out_gaa(x1, x2, x3)  =  ap2_out_gaa
U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)
ap2_in_aaa(x1, x2, x3)  =  ap2_in_aaa
ap2_out_aaa(x1, x2, x3)  =  ap2_out_aaa(x1)
U2_aaa(x1, x2, x3, x4, x5)  =  U2_aaa(x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5, x6)  =  U4_aa(x1, x6)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x1, x4)
AP1_IN_AGA(x1, x2, x3)  =  AP1_IN_AGA(x2)
U5_AA(x1, x2, x3, x4)  =  U5_AA(x1, x4)
U2_GAA(x1, x2, x3, x4, x5)  =  U2_GAA(x5)
U4_AA(x1, x2, x3, x4, x5, x6)  =  U4_AA(x1, x6)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x4)
U5_GA(x1, x2, x3, x4)  =  U5_GA(x4)
U2_AAA(x1, x2, x3, x4, x5)  =  U2_AAA(x5)
AP1_IN_AGG(x1, x2, x3)  =  AP1_IN_AGG(x2, x3)
AP2_IN_GAA(x1, x2, x3)  =  AP2_IN_GAA(x1)
U4_GA(x1, x2, x3, x4, x5, x6)  =  U4_GA(x6)
PERM_IN_AA(x1, x2)  =  PERM_IN_AA
AP2_IN_AAA(x1, x2, x3)  =  AP2_IN_AAA
PERM_IN_GA(x1, x2)  =  PERM_IN_GA(x1)
U1_AGG(x1, x2, x3, x4, x5)  =  U1_AGG(x5)
U1_AGA(x1, x2, x3, x4, x5)  =  U1_AGA(x5)
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 15 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

AP2_IN_AAA(cons(H, X), Y, cons(H, Z)) → AP2_IN_AAA(X, Y, Z)

The TRS R consists of the following rules:

perm_in_ga(nil, nil) → perm_out_ga(nil, nil)
perm_in_ga(Xs, cons(X, Ys)) → U3_ga(Xs, X, Ys, ap1_in_agg(X1s, cons(X, X2s), Xs))
ap1_in_agg(nil, X, X) → ap1_out_agg(nil, X, X)
ap1_in_agg(cons(H, X), Y, cons(H, Z)) → U1_agg(H, X, Y, Z, ap1_in_aga(X, Y, Z))
ap1_in_aga(nil, X, X) → ap1_out_aga(nil, X, X)
ap1_in_aga(cons(H, X), Y, cons(H, Z)) → U1_aga(H, X, Y, Z, ap1_in_aga(X, Y, Z))
U1_aga(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons(H, X), Y, cons(H, Z))
U1_agg(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_agg(cons(H, X), Y, cons(H, Z))
U3_ga(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → U4_ga(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
ap2_in_gaa(nil, X, X) → ap2_out_gaa(nil, X, X)
ap2_in_gaa(cons(H, X), Y, cons(H, Z)) → U2_gaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
ap2_in_aaa(nil, X, X) → ap2_out_aaa(nil, X, X)
ap2_in_aaa(cons(H, X), Y, cons(H, Z)) → U2_aaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
U2_aaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_aaa(cons(H, X), Y, cons(H, Z))
U2_gaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_gaa(cons(H, X), Y, cons(H, Z))
U4_ga(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_ga(Xs, X, Ys, perm_in_aa(Zs, Ys))
perm_in_aa(nil, nil) → perm_out_aa(nil, nil)
perm_in_aa(Xs, cons(X, Ys)) → U3_aa(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))
U3_aa(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_aa(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U4_aa(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_aa(Xs, X, Ys, perm_in_aa(Zs, Ys))
U5_aa(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_aa(Xs, cons(X, Ys))
U5_ga(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_ga(Xs, cons(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in_ga(x1, x2)  =  perm_in_ga(x1)
nil  =  nil
perm_out_ga(x1, x2)  =  perm_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x4)
ap1_in_agg(x1, x2, x3)  =  ap1_in_agg(x2, x3)
cons(x1, x2)  =  cons
ap1_out_agg(x1, x2, x3)  =  ap1_out_agg(x1)
U1_agg(x1, x2, x3, x4, x5)  =  U1_agg(x5)
ap1_in_aga(x1, x2, x3)  =  ap1_in_aga(x2)
ap1_out_aga(x1, x2, x3)  =  ap1_out_aga(x1, x3)
U1_aga(x1, x2, x3, x4, x5)  =  U1_aga(x5)
U4_ga(x1, x2, x3, x4, x5, x6)  =  U4_ga(x6)
ap2_in_gaa(x1, x2, x3)  =  ap2_in_gaa(x1)
ap2_out_gaa(x1, x2, x3)  =  ap2_out_gaa
U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)
ap2_in_aaa(x1, x2, x3)  =  ap2_in_aaa
ap2_out_aaa(x1, x2, x3)  =  ap2_out_aaa(x1)
U2_aaa(x1, x2, x3, x4, x5)  =  U2_aaa(x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5, x6)  =  U4_aa(x1, x6)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x1, x4)
AP2_IN_AAA(x1, x2, x3)  =  AP2_IN_AAA

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

AP2_IN_AAA(cons(H, X), Y, cons(H, Z)) → AP2_IN_AAA(X, Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
cons(x1, x2)  =  cons
AP2_IN_AAA(x1, x2, x3)  =  AP2_IN_AAA

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ NonTerminationProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

AP2_IN_AAAAP2_IN_AAA

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

AP2_IN_AAAAP2_IN_AAA

The TRS R consists of the following rules:none


s = AP2_IN_AAA evaluates to t =AP2_IN_AAA

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from AP2_IN_AAA to AP2_IN_AAA.





↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

AP1_IN_AGA(cons(H, X), Y, cons(H, Z)) → AP1_IN_AGA(X, Y, Z)

The TRS R consists of the following rules:

perm_in_ga(nil, nil) → perm_out_ga(nil, nil)
perm_in_ga(Xs, cons(X, Ys)) → U3_ga(Xs, X, Ys, ap1_in_agg(X1s, cons(X, X2s), Xs))
ap1_in_agg(nil, X, X) → ap1_out_agg(nil, X, X)
ap1_in_agg(cons(H, X), Y, cons(H, Z)) → U1_agg(H, X, Y, Z, ap1_in_aga(X, Y, Z))
ap1_in_aga(nil, X, X) → ap1_out_aga(nil, X, X)
ap1_in_aga(cons(H, X), Y, cons(H, Z)) → U1_aga(H, X, Y, Z, ap1_in_aga(X, Y, Z))
U1_aga(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons(H, X), Y, cons(H, Z))
U1_agg(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_agg(cons(H, X), Y, cons(H, Z))
U3_ga(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → U4_ga(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
ap2_in_gaa(nil, X, X) → ap2_out_gaa(nil, X, X)
ap2_in_gaa(cons(H, X), Y, cons(H, Z)) → U2_gaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
ap2_in_aaa(nil, X, X) → ap2_out_aaa(nil, X, X)
ap2_in_aaa(cons(H, X), Y, cons(H, Z)) → U2_aaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
U2_aaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_aaa(cons(H, X), Y, cons(H, Z))
U2_gaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_gaa(cons(H, X), Y, cons(H, Z))
U4_ga(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_ga(Xs, X, Ys, perm_in_aa(Zs, Ys))
perm_in_aa(nil, nil) → perm_out_aa(nil, nil)
perm_in_aa(Xs, cons(X, Ys)) → U3_aa(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))
U3_aa(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_aa(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U4_aa(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_aa(Xs, X, Ys, perm_in_aa(Zs, Ys))
U5_aa(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_aa(Xs, cons(X, Ys))
U5_ga(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_ga(Xs, cons(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in_ga(x1, x2)  =  perm_in_ga(x1)
nil  =  nil
perm_out_ga(x1, x2)  =  perm_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x4)
ap1_in_agg(x1, x2, x3)  =  ap1_in_agg(x2, x3)
cons(x1, x2)  =  cons
ap1_out_agg(x1, x2, x3)  =  ap1_out_agg(x1)
U1_agg(x1, x2, x3, x4, x5)  =  U1_agg(x5)
ap1_in_aga(x1, x2, x3)  =  ap1_in_aga(x2)
ap1_out_aga(x1, x2, x3)  =  ap1_out_aga(x1, x3)
U1_aga(x1, x2, x3, x4, x5)  =  U1_aga(x5)
U4_ga(x1, x2, x3, x4, x5, x6)  =  U4_ga(x6)
ap2_in_gaa(x1, x2, x3)  =  ap2_in_gaa(x1)
ap2_out_gaa(x1, x2, x3)  =  ap2_out_gaa
U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)
ap2_in_aaa(x1, x2, x3)  =  ap2_in_aaa
ap2_out_aaa(x1, x2, x3)  =  ap2_out_aaa(x1)
U2_aaa(x1, x2, x3, x4, x5)  =  U2_aaa(x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5, x6)  =  U4_aa(x1, x6)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x1, x4)
AP1_IN_AGA(x1, x2, x3)  =  AP1_IN_AGA(x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

AP1_IN_AGA(cons(H, X), Y, cons(H, Z)) → AP1_IN_AGA(X, Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
cons(x1, x2)  =  cons
AP1_IN_AGA(x1, x2, x3)  =  AP1_IN_AGA(x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ NonTerminationProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

AP1_IN_AGA(Y) → AP1_IN_AGA(Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

AP1_IN_AGA(Y) → AP1_IN_AGA(Y)

The TRS R consists of the following rules:none


s = AP1_IN_AGA(Y) evaluates to t =AP1_IN_AGA(Y)

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from AP1_IN_AGA(Y) to AP1_IN_AGA(Y).





↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

U4_AA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → PERM_IN_AA(Zs, Ys)
U3_AA(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_AA(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
PERM_IN_AA(Xs, cons(X, Ys)) → U3_AA(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))

The TRS R consists of the following rules:

perm_in_ga(nil, nil) → perm_out_ga(nil, nil)
perm_in_ga(Xs, cons(X, Ys)) → U3_ga(Xs, X, Ys, ap1_in_agg(X1s, cons(X, X2s), Xs))
ap1_in_agg(nil, X, X) → ap1_out_agg(nil, X, X)
ap1_in_agg(cons(H, X), Y, cons(H, Z)) → U1_agg(H, X, Y, Z, ap1_in_aga(X, Y, Z))
ap1_in_aga(nil, X, X) → ap1_out_aga(nil, X, X)
ap1_in_aga(cons(H, X), Y, cons(H, Z)) → U1_aga(H, X, Y, Z, ap1_in_aga(X, Y, Z))
U1_aga(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons(H, X), Y, cons(H, Z))
U1_agg(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_agg(cons(H, X), Y, cons(H, Z))
U3_ga(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → U4_ga(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
ap2_in_gaa(nil, X, X) → ap2_out_gaa(nil, X, X)
ap2_in_gaa(cons(H, X), Y, cons(H, Z)) → U2_gaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
ap2_in_aaa(nil, X, X) → ap2_out_aaa(nil, X, X)
ap2_in_aaa(cons(H, X), Y, cons(H, Z)) → U2_aaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
U2_aaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_aaa(cons(H, X), Y, cons(H, Z))
U2_gaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_gaa(cons(H, X), Y, cons(H, Z))
U4_ga(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_ga(Xs, X, Ys, perm_in_aa(Zs, Ys))
perm_in_aa(nil, nil) → perm_out_aa(nil, nil)
perm_in_aa(Xs, cons(X, Ys)) → U3_aa(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))
U3_aa(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_aa(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U4_aa(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_aa(Xs, X, Ys, perm_in_aa(Zs, Ys))
U5_aa(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_aa(Xs, cons(X, Ys))
U5_ga(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_ga(Xs, cons(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in_ga(x1, x2)  =  perm_in_ga(x1)
nil  =  nil
perm_out_ga(x1, x2)  =  perm_out_ga(x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x4)
ap1_in_agg(x1, x2, x3)  =  ap1_in_agg(x2, x3)
cons(x1, x2)  =  cons
ap1_out_agg(x1, x2, x3)  =  ap1_out_agg(x1)
U1_agg(x1, x2, x3, x4, x5)  =  U1_agg(x5)
ap1_in_aga(x1, x2, x3)  =  ap1_in_aga(x2)
ap1_out_aga(x1, x2, x3)  =  ap1_out_aga(x1, x3)
U1_aga(x1, x2, x3, x4, x5)  =  U1_aga(x5)
U4_ga(x1, x2, x3, x4, x5, x6)  =  U4_ga(x6)
ap2_in_gaa(x1, x2, x3)  =  ap2_in_gaa(x1)
ap2_out_gaa(x1, x2, x3)  =  ap2_out_gaa
U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)
ap2_in_aaa(x1, x2, x3)  =  ap2_in_aaa
ap2_out_aaa(x1, x2, x3)  =  ap2_out_aaa(x1)
U2_aaa(x1, x2, x3, x4, x5)  =  U2_aaa(x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x4)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5, x6)  =  U4_aa(x1, x6)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x1, x4)
U4_AA(x1, x2, x3, x4, x5, x6)  =  U4_AA(x1, x6)
PERM_IN_AA(x1, x2)  =  PERM_IN_AA
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

U4_AA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → PERM_IN_AA(Zs, Ys)
U3_AA(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_AA(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
PERM_IN_AA(Xs, cons(X, Ys)) → U3_AA(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))

The TRS R consists of the following rules:

ap2_in_gaa(nil, X, X) → ap2_out_gaa(nil, X, X)
ap2_in_gaa(cons(H, X), Y, cons(H, Z)) → U2_gaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
ap1_in_aga(nil, X, X) → ap1_out_aga(nil, X, X)
ap1_in_aga(cons(H, X), Y, cons(H, Z)) → U1_aga(H, X, Y, Z, ap1_in_aga(X, Y, Z))
U2_gaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_gaa(cons(H, X), Y, cons(H, Z))
U1_aga(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons(H, X), Y, cons(H, Z))
ap2_in_aaa(nil, X, X) → ap2_out_aaa(nil, X, X)
ap2_in_aaa(cons(H, X), Y, cons(H, Z)) → U2_aaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
U2_aaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_aaa(cons(H, X), Y, cons(H, Z))

The argument filtering Pi contains the following mapping:
nil  =  nil
cons(x1, x2)  =  cons
ap1_in_aga(x1, x2, x3)  =  ap1_in_aga(x2)
ap1_out_aga(x1, x2, x3)  =  ap1_out_aga(x1, x3)
U1_aga(x1, x2, x3, x4, x5)  =  U1_aga(x5)
ap2_in_gaa(x1, x2, x3)  =  ap2_in_gaa(x1)
ap2_out_gaa(x1, x2, x3)  =  ap2_out_gaa
U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)
ap2_in_aaa(x1, x2, x3)  =  ap2_in_aaa
ap2_out_aaa(x1, x2, x3)  =  ap2_out_aaa(x1)
U2_aaa(x1, x2, x3, x4, x5)  =  U2_aaa(x5)
U4_AA(x1, x2, x3, x4, x5, x6)  =  U4_AA(x1, x6)
PERM_IN_AA(x1, x2)  =  PERM_IN_AA
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Narrowing
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U4_AA(Xs, ap2_out_gaa) → PERM_IN_AA
PERM_IN_AAU3_AA(ap1_in_aga(cons))
U3_AA(ap1_out_aga(X1s, Xs)) → U4_AA(Xs, ap2_in_gaa(X1s))

The TRS R consists of the following rules:

ap2_in_gaa(nil) → ap2_out_gaa
ap2_in_gaa(cons) → U2_gaa(ap2_in_aaa)
ap1_in_aga(X) → ap1_out_aga(nil, X)
ap1_in_aga(Y) → U1_aga(ap1_in_aga(Y))
U2_gaa(ap2_out_aaa(X)) → ap2_out_gaa
U1_aga(ap1_out_aga(X, Z)) → ap1_out_aga(cons, cons)
ap2_in_aaaap2_out_aaa(nil)
ap2_in_aaaU2_aaa(ap2_in_aaa)
U2_aaa(ap2_out_aaa(X)) → ap2_out_aaa(cons)

The set Q consists of the following terms:

ap2_in_gaa(x0)
ap1_in_aga(x0)
U2_gaa(x0)
U1_aga(x0)
ap2_in_aaa
U2_aaa(x0)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule U3_AA(ap1_out_aga(X1s, Xs)) → U4_AA(Xs, ap2_in_gaa(X1s)) at position [1] we obtained the following new rules:

U3_AA(ap1_out_aga(nil, y1)) → U4_AA(y1, ap2_out_gaa)
U3_AA(ap1_out_aga(cons, y1)) → U4_AA(y1, U2_gaa(ap2_in_aaa))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
QDP
                            ↳ UsableRulesProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U3_AA(ap1_out_aga(nil, y1)) → U4_AA(y1, ap2_out_gaa)
U4_AA(Xs, ap2_out_gaa) → PERM_IN_AA
U3_AA(ap1_out_aga(cons, y1)) → U4_AA(y1, U2_gaa(ap2_in_aaa))
PERM_IN_AAU3_AA(ap1_in_aga(cons))

The TRS R consists of the following rules:

ap2_in_gaa(nil) → ap2_out_gaa
ap2_in_gaa(cons) → U2_gaa(ap2_in_aaa)
ap1_in_aga(X) → ap1_out_aga(nil, X)
ap1_in_aga(Y) → U1_aga(ap1_in_aga(Y))
U2_gaa(ap2_out_aaa(X)) → ap2_out_gaa
U1_aga(ap1_out_aga(X, Z)) → ap1_out_aga(cons, cons)
ap2_in_aaaap2_out_aaa(nil)
ap2_in_aaaU2_aaa(ap2_in_aaa)
U2_aaa(ap2_out_aaa(X)) → ap2_out_aaa(cons)

The set Q consists of the following terms:

ap2_in_gaa(x0)
ap1_in_aga(x0)
U2_gaa(x0)
U1_aga(x0)
ap2_in_aaa
U2_aaa(x0)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ UsableRulesProof
QDP
                                ↳ QReductionProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U3_AA(ap1_out_aga(nil, y1)) → U4_AA(y1, ap2_out_gaa)
U4_AA(Xs, ap2_out_gaa) → PERM_IN_AA
U3_AA(ap1_out_aga(cons, y1)) → U4_AA(y1, U2_gaa(ap2_in_aaa))
PERM_IN_AAU3_AA(ap1_in_aga(cons))

The TRS R consists of the following rules:

ap1_in_aga(X) → ap1_out_aga(nil, X)
ap1_in_aga(Y) → U1_aga(ap1_in_aga(Y))
U1_aga(ap1_out_aga(X, Z)) → ap1_out_aga(cons, cons)
ap2_in_aaaap2_out_aaa(nil)
ap2_in_aaaU2_aaa(ap2_in_aaa)
U2_gaa(ap2_out_aaa(X)) → ap2_out_gaa
U2_aaa(ap2_out_aaa(X)) → ap2_out_aaa(cons)

The set Q consists of the following terms:

ap2_in_gaa(x0)
ap1_in_aga(x0)
U2_gaa(x0)
U1_aga(x0)
ap2_in_aaa
U2_aaa(x0)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

ap2_in_gaa(x0)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ UsableRulesProof
                              ↳ QDP
                                ↳ QReductionProof
QDP
                                    ↳ Narrowing
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U4_AA(Xs, ap2_out_gaa) → PERM_IN_AA
U3_AA(ap1_out_aga(nil, y1)) → U4_AA(y1, ap2_out_gaa)
PERM_IN_AAU3_AA(ap1_in_aga(cons))
U3_AA(ap1_out_aga(cons, y1)) → U4_AA(y1, U2_gaa(ap2_in_aaa))

The TRS R consists of the following rules:

ap1_in_aga(X) → ap1_out_aga(nil, X)
ap1_in_aga(Y) → U1_aga(ap1_in_aga(Y))
U1_aga(ap1_out_aga(X, Z)) → ap1_out_aga(cons, cons)
ap2_in_aaaap2_out_aaa(nil)
ap2_in_aaaU2_aaa(ap2_in_aaa)
U2_gaa(ap2_out_aaa(X)) → ap2_out_gaa
U2_aaa(ap2_out_aaa(X)) → ap2_out_aaa(cons)

The set Q consists of the following terms:

ap1_in_aga(x0)
U2_gaa(x0)
U1_aga(x0)
ap2_in_aaa
U2_aaa(x0)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule PERM_IN_AAU3_AA(ap1_in_aga(cons)) at position [0] we obtained the following new rules:

PERM_IN_AAU3_AA(ap1_out_aga(nil, cons))
PERM_IN_AAU3_AA(U1_aga(ap1_in_aga(cons)))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ UsableRulesProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
QDP
                                        ↳ NonTerminationProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

PERM_IN_AAU3_AA(U1_aga(ap1_in_aga(cons)))
U3_AA(ap1_out_aga(nil, y1)) → U4_AA(y1, ap2_out_gaa)
U4_AA(Xs, ap2_out_gaa) → PERM_IN_AA
PERM_IN_AAU3_AA(ap1_out_aga(nil, cons))
U3_AA(ap1_out_aga(cons, y1)) → U4_AA(y1, U2_gaa(ap2_in_aaa))

The TRS R consists of the following rules:

ap1_in_aga(X) → ap1_out_aga(nil, X)
ap1_in_aga(Y) → U1_aga(ap1_in_aga(Y))
U1_aga(ap1_out_aga(X, Z)) → ap1_out_aga(cons, cons)
ap2_in_aaaap2_out_aaa(nil)
ap2_in_aaaU2_aaa(ap2_in_aaa)
U2_gaa(ap2_out_aaa(X)) → ap2_out_gaa
U2_aaa(ap2_out_aaa(X)) → ap2_out_aaa(cons)

The set Q consists of the following terms:

ap1_in_aga(x0)
U2_gaa(x0)
U1_aga(x0)
ap2_in_aaa
U2_aaa(x0)

We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

The TRS P consists of the following rules:

PERM_IN_AAU3_AA(U1_aga(ap1_in_aga(cons)))
U3_AA(ap1_out_aga(nil, y1)) → U4_AA(y1, ap2_out_gaa)
U4_AA(Xs, ap2_out_gaa) → PERM_IN_AA
PERM_IN_AAU3_AA(ap1_out_aga(nil, cons))
U3_AA(ap1_out_aga(cons, y1)) → U4_AA(y1, U2_gaa(ap2_in_aaa))

The TRS R consists of the following rules:

ap1_in_aga(X) → ap1_out_aga(nil, X)
ap1_in_aga(Y) → U1_aga(ap1_in_aga(Y))
U1_aga(ap1_out_aga(X, Z)) → ap1_out_aga(cons, cons)
ap2_in_aaaap2_out_aaa(nil)
ap2_in_aaaU2_aaa(ap2_in_aaa)
U2_gaa(ap2_out_aaa(X)) → ap2_out_gaa
U2_aaa(ap2_out_aaa(X)) → ap2_out_aaa(cons)


s = U4_AA(Xs, ap2_out_gaa) evaluates to t =U4_AA(cons, ap2_out_gaa)

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

U4_AA(Xs, ap2_out_gaa)PERM_IN_AA
with rule U4_AA(Xs', ap2_out_gaa) → PERM_IN_AA at position [] and matcher [Xs' / Xs]

PERM_IN_AAU3_AA(ap1_out_aga(nil, cons))
with rule PERM_IN_AAU3_AA(ap1_out_aga(nil, cons)) at position [] and matcher [ ]

U3_AA(ap1_out_aga(nil, cons))U4_AA(cons, ap2_out_gaa)
with rule U3_AA(ap1_out_aga(nil, y1)) → U4_AA(y1, ap2_out_gaa)

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.




We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
perm_in: (b,f) (f,f)
ap1_in: (f,b,b) (f,b,f)
ap2_in: (b,f,f) (f,f,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

perm_in_ga(nil, nil) → perm_out_ga(nil, nil)
perm_in_ga(Xs, cons(X, Ys)) → U3_ga(Xs, X, Ys, ap1_in_agg(X1s, cons(X, X2s), Xs))
ap1_in_agg(nil, X, X) → ap1_out_agg(nil, X, X)
ap1_in_agg(cons(H, X), Y, cons(H, Z)) → U1_agg(H, X, Y, Z, ap1_in_aga(X, Y, Z))
ap1_in_aga(nil, X, X) → ap1_out_aga(nil, X, X)
ap1_in_aga(cons(H, X), Y, cons(H, Z)) → U1_aga(H, X, Y, Z, ap1_in_aga(X, Y, Z))
U1_aga(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons(H, X), Y, cons(H, Z))
U1_agg(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_agg(cons(H, X), Y, cons(H, Z))
U3_ga(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → U4_ga(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
ap2_in_gaa(nil, X, X) → ap2_out_gaa(nil, X, X)
ap2_in_gaa(cons(H, X), Y, cons(H, Z)) → U2_gaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
ap2_in_aaa(nil, X, X) → ap2_out_aaa(nil, X, X)
ap2_in_aaa(cons(H, X), Y, cons(H, Z)) → U2_aaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
U2_aaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_aaa(cons(H, X), Y, cons(H, Z))
U2_gaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_gaa(cons(H, X), Y, cons(H, Z))
U4_ga(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_ga(Xs, X, Ys, perm_in_aa(Zs, Ys))
perm_in_aa(nil, nil) → perm_out_aa(nil, nil)
perm_in_aa(Xs, cons(X, Ys)) → U3_aa(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))
U3_aa(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_aa(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U4_aa(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_aa(Xs, X, Ys, perm_in_aa(Zs, Ys))
U5_aa(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_aa(Xs, cons(X, Ys))
U5_ga(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_ga(Xs, cons(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in_ga(x1, x2)  =  perm_in_ga(x1)
nil  =  nil
perm_out_ga(x1, x2)  =  perm_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
ap1_in_agg(x1, x2, x3)  =  ap1_in_agg(x2, x3)
cons(x1, x2)  =  cons
ap1_out_agg(x1, x2, x3)  =  ap1_out_agg(x1, x2, x3)
U1_agg(x1, x2, x3, x4, x5)  =  U1_agg(x3, x5)
ap1_in_aga(x1, x2, x3)  =  ap1_in_aga(x2)
ap1_out_aga(x1, x2, x3)  =  ap1_out_aga(x1, x2, x3)
U1_aga(x1, x2, x3, x4, x5)  =  U1_aga(x3, x5)
U4_ga(x1, x2, x3, x4, x5, x6)  =  U4_ga(x1, x6)
ap2_in_gaa(x1, x2, x3)  =  ap2_in_gaa(x1)
ap2_out_gaa(x1, x2, x3)  =  ap2_out_gaa(x1)
U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)
ap2_in_aaa(x1, x2, x3)  =  ap2_in_aaa
ap2_out_aaa(x1, x2, x3)  =  ap2_out_aaa(x1)
U2_aaa(x1, x2, x3, x4, x5)  =  U2_aaa(x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x4)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5, x6)  =  U4_aa(x1, x6)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x1, x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

perm_in_ga(nil, nil) → perm_out_ga(nil, nil)
perm_in_ga(Xs, cons(X, Ys)) → U3_ga(Xs, X, Ys, ap1_in_agg(X1s, cons(X, X2s), Xs))
ap1_in_agg(nil, X, X) → ap1_out_agg(nil, X, X)
ap1_in_agg(cons(H, X), Y, cons(H, Z)) → U1_agg(H, X, Y, Z, ap1_in_aga(X, Y, Z))
ap1_in_aga(nil, X, X) → ap1_out_aga(nil, X, X)
ap1_in_aga(cons(H, X), Y, cons(H, Z)) → U1_aga(H, X, Y, Z, ap1_in_aga(X, Y, Z))
U1_aga(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons(H, X), Y, cons(H, Z))
U1_agg(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_agg(cons(H, X), Y, cons(H, Z))
U3_ga(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → U4_ga(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
ap2_in_gaa(nil, X, X) → ap2_out_gaa(nil, X, X)
ap2_in_gaa(cons(H, X), Y, cons(H, Z)) → U2_gaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
ap2_in_aaa(nil, X, X) → ap2_out_aaa(nil, X, X)
ap2_in_aaa(cons(H, X), Y, cons(H, Z)) → U2_aaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
U2_aaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_aaa(cons(H, X), Y, cons(H, Z))
U2_gaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_gaa(cons(H, X), Y, cons(H, Z))
U4_ga(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_ga(Xs, X, Ys, perm_in_aa(Zs, Ys))
perm_in_aa(nil, nil) → perm_out_aa(nil, nil)
perm_in_aa(Xs, cons(X, Ys)) → U3_aa(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))
U3_aa(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_aa(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U4_aa(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_aa(Xs, X, Ys, perm_in_aa(Zs, Ys))
U5_aa(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_aa(Xs, cons(X, Ys))
U5_ga(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_ga(Xs, cons(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in_ga(x1, x2)  =  perm_in_ga(x1)
nil  =  nil
perm_out_ga(x1, x2)  =  perm_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
ap1_in_agg(x1, x2, x3)  =  ap1_in_agg(x2, x3)
cons(x1, x2)  =  cons
ap1_out_agg(x1, x2, x3)  =  ap1_out_agg(x1, x2, x3)
U1_agg(x1, x2, x3, x4, x5)  =  U1_agg(x3, x5)
ap1_in_aga(x1, x2, x3)  =  ap1_in_aga(x2)
ap1_out_aga(x1, x2, x3)  =  ap1_out_aga(x1, x2, x3)
U1_aga(x1, x2, x3, x4, x5)  =  U1_aga(x3, x5)
U4_ga(x1, x2, x3, x4, x5, x6)  =  U4_ga(x1, x6)
ap2_in_gaa(x1, x2, x3)  =  ap2_in_gaa(x1)
ap2_out_gaa(x1, x2, x3)  =  ap2_out_gaa(x1)
U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)
ap2_in_aaa(x1, x2, x3)  =  ap2_in_aaa
ap2_out_aaa(x1, x2, x3)  =  ap2_out_aaa(x1)
U2_aaa(x1, x2, x3, x4, x5)  =  U2_aaa(x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x4)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5, x6)  =  U4_aa(x1, x6)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x1, x4)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

PERM_IN_GA(Xs, cons(X, Ys)) → U3_GA(Xs, X, Ys, ap1_in_agg(X1s, cons(X, X2s), Xs))
PERM_IN_GA(Xs, cons(X, Ys)) → AP1_IN_AGG(X1s, cons(X, X2s), Xs)
AP1_IN_AGG(cons(H, X), Y, cons(H, Z)) → U1_AGG(H, X, Y, Z, ap1_in_aga(X, Y, Z))
AP1_IN_AGG(cons(H, X), Y, cons(H, Z)) → AP1_IN_AGA(X, Y, Z)
AP1_IN_AGA(cons(H, X), Y, cons(H, Z)) → U1_AGA(H, X, Y, Z, ap1_in_aga(X, Y, Z))
AP1_IN_AGA(cons(H, X), Y, cons(H, Z)) → AP1_IN_AGA(X, Y, Z)
U3_GA(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → U4_GA(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U3_GA(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → AP2_IN_GAA(X1s, X2s, Zs)
AP2_IN_GAA(cons(H, X), Y, cons(H, Z)) → U2_GAA(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
AP2_IN_GAA(cons(H, X), Y, cons(H, Z)) → AP2_IN_AAA(X, Y, Z)
AP2_IN_AAA(cons(H, X), Y, cons(H, Z)) → U2_AAA(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
AP2_IN_AAA(cons(H, X), Y, cons(H, Z)) → AP2_IN_AAA(X, Y, Z)
U4_GA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_GA(Xs, X, Ys, perm_in_aa(Zs, Ys))
U4_GA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → PERM_IN_AA(Zs, Ys)
PERM_IN_AA(Xs, cons(X, Ys)) → U3_AA(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))
PERM_IN_AA(Xs, cons(X, Ys)) → AP1_IN_AGA(X1s, cons(X, X2s), Xs)
U3_AA(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_AA(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U3_AA(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → AP2_IN_GAA(X1s, X2s, Zs)
U4_AA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_AA(Xs, X, Ys, perm_in_aa(Zs, Ys))
U4_AA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → PERM_IN_AA(Zs, Ys)

The TRS R consists of the following rules:

perm_in_ga(nil, nil) → perm_out_ga(nil, nil)
perm_in_ga(Xs, cons(X, Ys)) → U3_ga(Xs, X, Ys, ap1_in_agg(X1s, cons(X, X2s), Xs))
ap1_in_agg(nil, X, X) → ap1_out_agg(nil, X, X)
ap1_in_agg(cons(H, X), Y, cons(H, Z)) → U1_agg(H, X, Y, Z, ap1_in_aga(X, Y, Z))
ap1_in_aga(nil, X, X) → ap1_out_aga(nil, X, X)
ap1_in_aga(cons(H, X), Y, cons(H, Z)) → U1_aga(H, X, Y, Z, ap1_in_aga(X, Y, Z))
U1_aga(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons(H, X), Y, cons(H, Z))
U1_agg(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_agg(cons(H, X), Y, cons(H, Z))
U3_ga(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → U4_ga(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
ap2_in_gaa(nil, X, X) → ap2_out_gaa(nil, X, X)
ap2_in_gaa(cons(H, X), Y, cons(H, Z)) → U2_gaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
ap2_in_aaa(nil, X, X) → ap2_out_aaa(nil, X, X)
ap2_in_aaa(cons(H, X), Y, cons(H, Z)) → U2_aaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
U2_aaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_aaa(cons(H, X), Y, cons(H, Z))
U2_gaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_gaa(cons(H, X), Y, cons(H, Z))
U4_ga(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_ga(Xs, X, Ys, perm_in_aa(Zs, Ys))
perm_in_aa(nil, nil) → perm_out_aa(nil, nil)
perm_in_aa(Xs, cons(X, Ys)) → U3_aa(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))
U3_aa(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_aa(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U4_aa(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_aa(Xs, X, Ys, perm_in_aa(Zs, Ys))
U5_aa(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_aa(Xs, cons(X, Ys))
U5_ga(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_ga(Xs, cons(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in_ga(x1, x2)  =  perm_in_ga(x1)
nil  =  nil
perm_out_ga(x1, x2)  =  perm_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
ap1_in_agg(x1, x2, x3)  =  ap1_in_agg(x2, x3)
cons(x1, x2)  =  cons
ap1_out_agg(x1, x2, x3)  =  ap1_out_agg(x1, x2, x3)
U1_agg(x1, x2, x3, x4, x5)  =  U1_agg(x3, x5)
ap1_in_aga(x1, x2, x3)  =  ap1_in_aga(x2)
ap1_out_aga(x1, x2, x3)  =  ap1_out_aga(x1, x2, x3)
U1_aga(x1, x2, x3, x4, x5)  =  U1_aga(x3, x5)
U4_ga(x1, x2, x3, x4, x5, x6)  =  U4_ga(x1, x6)
ap2_in_gaa(x1, x2, x3)  =  ap2_in_gaa(x1)
ap2_out_gaa(x1, x2, x3)  =  ap2_out_gaa(x1)
U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)
ap2_in_aaa(x1, x2, x3)  =  ap2_in_aaa
ap2_out_aaa(x1, x2, x3)  =  ap2_out_aaa(x1)
U2_aaa(x1, x2, x3, x4, x5)  =  U2_aaa(x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x4)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5, x6)  =  U4_aa(x1, x6)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x1, x4)
AP1_IN_AGA(x1, x2, x3)  =  AP1_IN_AGA(x2)
U5_AA(x1, x2, x3, x4)  =  U5_AA(x1, x4)
U2_GAA(x1, x2, x3, x4, x5)  =  U2_GAA(x5)
U4_AA(x1, x2, x3, x4, x5, x6)  =  U4_AA(x1, x6)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x1, x4)
U5_GA(x1, x2, x3, x4)  =  U5_GA(x1, x4)
U2_AAA(x1, x2, x3, x4, x5)  =  U2_AAA(x5)
AP1_IN_AGG(x1, x2, x3)  =  AP1_IN_AGG(x2, x3)
AP2_IN_GAA(x1, x2, x3)  =  AP2_IN_GAA(x1)
U4_GA(x1, x2, x3, x4, x5, x6)  =  U4_GA(x1, x6)
PERM_IN_AA(x1, x2)  =  PERM_IN_AA
AP2_IN_AAA(x1, x2, x3)  =  AP2_IN_AAA
PERM_IN_GA(x1, x2)  =  PERM_IN_GA(x1)
U1_AGG(x1, x2, x3, x4, x5)  =  U1_AGG(x3, x5)
U1_AGA(x1, x2, x3, x4, x5)  =  U1_AGA(x3, x5)
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

PERM_IN_GA(Xs, cons(X, Ys)) → U3_GA(Xs, X, Ys, ap1_in_agg(X1s, cons(X, X2s), Xs))
PERM_IN_GA(Xs, cons(X, Ys)) → AP1_IN_AGG(X1s, cons(X, X2s), Xs)
AP1_IN_AGG(cons(H, X), Y, cons(H, Z)) → U1_AGG(H, X, Y, Z, ap1_in_aga(X, Y, Z))
AP1_IN_AGG(cons(H, X), Y, cons(H, Z)) → AP1_IN_AGA(X, Y, Z)
AP1_IN_AGA(cons(H, X), Y, cons(H, Z)) → U1_AGA(H, X, Y, Z, ap1_in_aga(X, Y, Z))
AP1_IN_AGA(cons(H, X), Y, cons(H, Z)) → AP1_IN_AGA(X, Y, Z)
U3_GA(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → U4_GA(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U3_GA(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → AP2_IN_GAA(X1s, X2s, Zs)
AP2_IN_GAA(cons(H, X), Y, cons(H, Z)) → U2_GAA(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
AP2_IN_GAA(cons(H, X), Y, cons(H, Z)) → AP2_IN_AAA(X, Y, Z)
AP2_IN_AAA(cons(H, X), Y, cons(H, Z)) → U2_AAA(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
AP2_IN_AAA(cons(H, X), Y, cons(H, Z)) → AP2_IN_AAA(X, Y, Z)
U4_GA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_GA(Xs, X, Ys, perm_in_aa(Zs, Ys))
U4_GA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → PERM_IN_AA(Zs, Ys)
PERM_IN_AA(Xs, cons(X, Ys)) → U3_AA(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))
PERM_IN_AA(Xs, cons(X, Ys)) → AP1_IN_AGA(X1s, cons(X, X2s), Xs)
U3_AA(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_AA(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U3_AA(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → AP2_IN_GAA(X1s, X2s, Zs)
U4_AA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_AA(Xs, X, Ys, perm_in_aa(Zs, Ys))
U4_AA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → PERM_IN_AA(Zs, Ys)

The TRS R consists of the following rules:

perm_in_ga(nil, nil) → perm_out_ga(nil, nil)
perm_in_ga(Xs, cons(X, Ys)) → U3_ga(Xs, X, Ys, ap1_in_agg(X1s, cons(X, X2s), Xs))
ap1_in_agg(nil, X, X) → ap1_out_agg(nil, X, X)
ap1_in_agg(cons(H, X), Y, cons(H, Z)) → U1_agg(H, X, Y, Z, ap1_in_aga(X, Y, Z))
ap1_in_aga(nil, X, X) → ap1_out_aga(nil, X, X)
ap1_in_aga(cons(H, X), Y, cons(H, Z)) → U1_aga(H, X, Y, Z, ap1_in_aga(X, Y, Z))
U1_aga(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons(H, X), Y, cons(H, Z))
U1_agg(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_agg(cons(H, X), Y, cons(H, Z))
U3_ga(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → U4_ga(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
ap2_in_gaa(nil, X, X) → ap2_out_gaa(nil, X, X)
ap2_in_gaa(cons(H, X), Y, cons(H, Z)) → U2_gaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
ap2_in_aaa(nil, X, X) → ap2_out_aaa(nil, X, X)
ap2_in_aaa(cons(H, X), Y, cons(H, Z)) → U2_aaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
U2_aaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_aaa(cons(H, X), Y, cons(H, Z))
U2_gaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_gaa(cons(H, X), Y, cons(H, Z))
U4_ga(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_ga(Xs, X, Ys, perm_in_aa(Zs, Ys))
perm_in_aa(nil, nil) → perm_out_aa(nil, nil)
perm_in_aa(Xs, cons(X, Ys)) → U3_aa(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))
U3_aa(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_aa(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U4_aa(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_aa(Xs, X, Ys, perm_in_aa(Zs, Ys))
U5_aa(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_aa(Xs, cons(X, Ys))
U5_ga(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_ga(Xs, cons(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in_ga(x1, x2)  =  perm_in_ga(x1)
nil  =  nil
perm_out_ga(x1, x2)  =  perm_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
ap1_in_agg(x1, x2, x3)  =  ap1_in_agg(x2, x3)
cons(x1, x2)  =  cons
ap1_out_agg(x1, x2, x3)  =  ap1_out_agg(x1, x2, x3)
U1_agg(x1, x2, x3, x4, x5)  =  U1_agg(x3, x5)
ap1_in_aga(x1, x2, x3)  =  ap1_in_aga(x2)
ap1_out_aga(x1, x2, x3)  =  ap1_out_aga(x1, x2, x3)
U1_aga(x1, x2, x3, x4, x5)  =  U1_aga(x3, x5)
U4_ga(x1, x2, x3, x4, x5, x6)  =  U4_ga(x1, x6)
ap2_in_gaa(x1, x2, x3)  =  ap2_in_gaa(x1)
ap2_out_gaa(x1, x2, x3)  =  ap2_out_gaa(x1)
U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)
ap2_in_aaa(x1, x2, x3)  =  ap2_in_aaa
ap2_out_aaa(x1, x2, x3)  =  ap2_out_aaa(x1)
U2_aaa(x1, x2, x3, x4, x5)  =  U2_aaa(x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x4)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5, x6)  =  U4_aa(x1, x6)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x1, x4)
AP1_IN_AGA(x1, x2, x3)  =  AP1_IN_AGA(x2)
U5_AA(x1, x2, x3, x4)  =  U5_AA(x1, x4)
U2_GAA(x1, x2, x3, x4, x5)  =  U2_GAA(x5)
U4_AA(x1, x2, x3, x4, x5, x6)  =  U4_AA(x1, x6)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x1, x4)
U5_GA(x1, x2, x3, x4)  =  U5_GA(x1, x4)
U2_AAA(x1, x2, x3, x4, x5)  =  U2_AAA(x5)
AP1_IN_AGG(x1, x2, x3)  =  AP1_IN_AGG(x2, x3)
AP2_IN_GAA(x1, x2, x3)  =  AP2_IN_GAA(x1)
U4_GA(x1, x2, x3, x4, x5, x6)  =  U4_GA(x1, x6)
PERM_IN_AA(x1, x2)  =  PERM_IN_AA
AP2_IN_AAA(x1, x2, x3)  =  AP2_IN_AAA
PERM_IN_GA(x1, x2)  =  PERM_IN_GA(x1)
U1_AGG(x1, x2, x3, x4, x5)  =  U1_AGG(x3, x5)
U1_AGA(x1, x2, x3, x4, x5)  =  U1_AGA(x3, x5)
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 15 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

AP2_IN_AAA(cons(H, X), Y, cons(H, Z)) → AP2_IN_AAA(X, Y, Z)

The TRS R consists of the following rules:

perm_in_ga(nil, nil) → perm_out_ga(nil, nil)
perm_in_ga(Xs, cons(X, Ys)) → U3_ga(Xs, X, Ys, ap1_in_agg(X1s, cons(X, X2s), Xs))
ap1_in_agg(nil, X, X) → ap1_out_agg(nil, X, X)
ap1_in_agg(cons(H, X), Y, cons(H, Z)) → U1_agg(H, X, Y, Z, ap1_in_aga(X, Y, Z))
ap1_in_aga(nil, X, X) → ap1_out_aga(nil, X, X)
ap1_in_aga(cons(H, X), Y, cons(H, Z)) → U1_aga(H, X, Y, Z, ap1_in_aga(X, Y, Z))
U1_aga(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons(H, X), Y, cons(H, Z))
U1_agg(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_agg(cons(H, X), Y, cons(H, Z))
U3_ga(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → U4_ga(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
ap2_in_gaa(nil, X, X) → ap2_out_gaa(nil, X, X)
ap2_in_gaa(cons(H, X), Y, cons(H, Z)) → U2_gaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
ap2_in_aaa(nil, X, X) → ap2_out_aaa(nil, X, X)
ap2_in_aaa(cons(H, X), Y, cons(H, Z)) → U2_aaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
U2_aaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_aaa(cons(H, X), Y, cons(H, Z))
U2_gaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_gaa(cons(H, X), Y, cons(H, Z))
U4_ga(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_ga(Xs, X, Ys, perm_in_aa(Zs, Ys))
perm_in_aa(nil, nil) → perm_out_aa(nil, nil)
perm_in_aa(Xs, cons(X, Ys)) → U3_aa(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))
U3_aa(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_aa(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U4_aa(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_aa(Xs, X, Ys, perm_in_aa(Zs, Ys))
U5_aa(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_aa(Xs, cons(X, Ys))
U5_ga(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_ga(Xs, cons(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in_ga(x1, x2)  =  perm_in_ga(x1)
nil  =  nil
perm_out_ga(x1, x2)  =  perm_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
ap1_in_agg(x1, x2, x3)  =  ap1_in_agg(x2, x3)
cons(x1, x2)  =  cons
ap1_out_agg(x1, x2, x3)  =  ap1_out_agg(x1, x2, x3)
U1_agg(x1, x2, x3, x4, x5)  =  U1_agg(x3, x5)
ap1_in_aga(x1, x2, x3)  =  ap1_in_aga(x2)
ap1_out_aga(x1, x2, x3)  =  ap1_out_aga(x1, x2, x3)
U1_aga(x1, x2, x3, x4, x5)  =  U1_aga(x3, x5)
U4_ga(x1, x2, x3, x4, x5, x6)  =  U4_ga(x1, x6)
ap2_in_gaa(x1, x2, x3)  =  ap2_in_gaa(x1)
ap2_out_gaa(x1, x2, x3)  =  ap2_out_gaa(x1)
U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)
ap2_in_aaa(x1, x2, x3)  =  ap2_in_aaa
ap2_out_aaa(x1, x2, x3)  =  ap2_out_aaa(x1)
U2_aaa(x1, x2, x3, x4, x5)  =  U2_aaa(x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x4)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5, x6)  =  U4_aa(x1, x6)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x1, x4)
AP2_IN_AAA(x1, x2, x3)  =  AP2_IN_AAA

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

AP2_IN_AAA(cons(H, X), Y, cons(H, Z)) → AP2_IN_AAA(X, Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
cons(x1, x2)  =  cons
AP2_IN_AAA(x1, x2, x3)  =  AP2_IN_AAA

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ NonTerminationProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

AP2_IN_AAAAP2_IN_AAA

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

AP2_IN_AAAAP2_IN_AAA

The TRS R consists of the following rules:none


s = AP2_IN_AAA evaluates to t =AP2_IN_AAA

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from AP2_IN_AAA to AP2_IN_AAA.





↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

AP1_IN_AGA(cons(H, X), Y, cons(H, Z)) → AP1_IN_AGA(X, Y, Z)

The TRS R consists of the following rules:

perm_in_ga(nil, nil) → perm_out_ga(nil, nil)
perm_in_ga(Xs, cons(X, Ys)) → U3_ga(Xs, X, Ys, ap1_in_agg(X1s, cons(X, X2s), Xs))
ap1_in_agg(nil, X, X) → ap1_out_agg(nil, X, X)
ap1_in_agg(cons(H, X), Y, cons(H, Z)) → U1_agg(H, X, Y, Z, ap1_in_aga(X, Y, Z))
ap1_in_aga(nil, X, X) → ap1_out_aga(nil, X, X)
ap1_in_aga(cons(H, X), Y, cons(H, Z)) → U1_aga(H, X, Y, Z, ap1_in_aga(X, Y, Z))
U1_aga(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons(H, X), Y, cons(H, Z))
U1_agg(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_agg(cons(H, X), Y, cons(H, Z))
U3_ga(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → U4_ga(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
ap2_in_gaa(nil, X, X) → ap2_out_gaa(nil, X, X)
ap2_in_gaa(cons(H, X), Y, cons(H, Z)) → U2_gaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
ap2_in_aaa(nil, X, X) → ap2_out_aaa(nil, X, X)
ap2_in_aaa(cons(H, X), Y, cons(H, Z)) → U2_aaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
U2_aaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_aaa(cons(H, X), Y, cons(H, Z))
U2_gaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_gaa(cons(H, X), Y, cons(H, Z))
U4_ga(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_ga(Xs, X, Ys, perm_in_aa(Zs, Ys))
perm_in_aa(nil, nil) → perm_out_aa(nil, nil)
perm_in_aa(Xs, cons(X, Ys)) → U3_aa(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))
U3_aa(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_aa(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U4_aa(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_aa(Xs, X, Ys, perm_in_aa(Zs, Ys))
U5_aa(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_aa(Xs, cons(X, Ys))
U5_ga(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_ga(Xs, cons(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in_ga(x1, x2)  =  perm_in_ga(x1)
nil  =  nil
perm_out_ga(x1, x2)  =  perm_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
ap1_in_agg(x1, x2, x3)  =  ap1_in_agg(x2, x3)
cons(x1, x2)  =  cons
ap1_out_agg(x1, x2, x3)  =  ap1_out_agg(x1, x2, x3)
U1_agg(x1, x2, x3, x4, x5)  =  U1_agg(x3, x5)
ap1_in_aga(x1, x2, x3)  =  ap1_in_aga(x2)
ap1_out_aga(x1, x2, x3)  =  ap1_out_aga(x1, x2, x3)
U1_aga(x1, x2, x3, x4, x5)  =  U1_aga(x3, x5)
U4_ga(x1, x2, x3, x4, x5, x6)  =  U4_ga(x1, x6)
ap2_in_gaa(x1, x2, x3)  =  ap2_in_gaa(x1)
ap2_out_gaa(x1, x2, x3)  =  ap2_out_gaa(x1)
U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)
ap2_in_aaa(x1, x2, x3)  =  ap2_in_aaa
ap2_out_aaa(x1, x2, x3)  =  ap2_out_aaa(x1)
U2_aaa(x1, x2, x3, x4, x5)  =  U2_aaa(x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x4)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5, x6)  =  U4_aa(x1, x6)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x1, x4)
AP1_IN_AGA(x1, x2, x3)  =  AP1_IN_AGA(x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

AP1_IN_AGA(cons(H, X), Y, cons(H, Z)) → AP1_IN_AGA(X, Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
cons(x1, x2)  =  cons
AP1_IN_AGA(x1, x2, x3)  =  AP1_IN_AGA(x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ NonTerminationProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

AP1_IN_AGA(Y) → AP1_IN_AGA(Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

AP1_IN_AGA(Y) → AP1_IN_AGA(Y)

The TRS R consists of the following rules:none


s = AP1_IN_AGA(Y) evaluates to t =AP1_IN_AGA(Y)

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from AP1_IN_AGA(Y) to AP1_IN_AGA(Y).





↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

U4_AA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → PERM_IN_AA(Zs, Ys)
U3_AA(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_AA(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
PERM_IN_AA(Xs, cons(X, Ys)) → U3_AA(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))

The TRS R consists of the following rules:

perm_in_ga(nil, nil) → perm_out_ga(nil, nil)
perm_in_ga(Xs, cons(X, Ys)) → U3_ga(Xs, X, Ys, ap1_in_agg(X1s, cons(X, X2s), Xs))
ap1_in_agg(nil, X, X) → ap1_out_agg(nil, X, X)
ap1_in_agg(cons(H, X), Y, cons(H, Z)) → U1_agg(H, X, Y, Z, ap1_in_aga(X, Y, Z))
ap1_in_aga(nil, X, X) → ap1_out_aga(nil, X, X)
ap1_in_aga(cons(H, X), Y, cons(H, Z)) → U1_aga(H, X, Y, Z, ap1_in_aga(X, Y, Z))
U1_aga(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons(H, X), Y, cons(H, Z))
U1_agg(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_agg(cons(H, X), Y, cons(H, Z))
U3_ga(Xs, X, Ys, ap1_out_agg(X1s, cons(X, X2s), Xs)) → U4_ga(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
ap2_in_gaa(nil, X, X) → ap2_out_gaa(nil, X, X)
ap2_in_gaa(cons(H, X), Y, cons(H, Z)) → U2_gaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
ap2_in_aaa(nil, X, X) → ap2_out_aaa(nil, X, X)
ap2_in_aaa(cons(H, X), Y, cons(H, Z)) → U2_aaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
U2_aaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_aaa(cons(H, X), Y, cons(H, Z))
U2_gaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_gaa(cons(H, X), Y, cons(H, Z))
U4_ga(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_ga(Xs, X, Ys, perm_in_aa(Zs, Ys))
perm_in_aa(nil, nil) → perm_out_aa(nil, nil)
perm_in_aa(Xs, cons(X, Ys)) → U3_aa(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))
U3_aa(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_aa(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
U4_aa(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → U5_aa(Xs, X, Ys, perm_in_aa(Zs, Ys))
U5_aa(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_aa(Xs, cons(X, Ys))
U5_ga(Xs, X, Ys, perm_out_aa(Zs, Ys)) → perm_out_ga(Xs, cons(X, Ys))

The argument filtering Pi contains the following mapping:
perm_in_ga(x1, x2)  =  perm_in_ga(x1)
nil  =  nil
perm_out_ga(x1, x2)  =  perm_out_ga(x1, x2)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x1, x4)
ap1_in_agg(x1, x2, x3)  =  ap1_in_agg(x2, x3)
cons(x1, x2)  =  cons
ap1_out_agg(x1, x2, x3)  =  ap1_out_agg(x1, x2, x3)
U1_agg(x1, x2, x3, x4, x5)  =  U1_agg(x3, x5)
ap1_in_aga(x1, x2, x3)  =  ap1_in_aga(x2)
ap1_out_aga(x1, x2, x3)  =  ap1_out_aga(x1, x2, x3)
U1_aga(x1, x2, x3, x4, x5)  =  U1_aga(x3, x5)
U4_ga(x1, x2, x3, x4, x5, x6)  =  U4_ga(x1, x6)
ap2_in_gaa(x1, x2, x3)  =  ap2_in_gaa(x1)
ap2_out_gaa(x1, x2, x3)  =  ap2_out_gaa(x1)
U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)
ap2_in_aaa(x1, x2, x3)  =  ap2_in_aaa
ap2_out_aaa(x1, x2, x3)  =  ap2_out_aaa(x1)
U2_aaa(x1, x2, x3, x4, x5)  =  U2_aaa(x5)
U5_ga(x1, x2, x3, x4)  =  U5_ga(x1, x4)
perm_in_aa(x1, x2)  =  perm_in_aa
perm_out_aa(x1, x2)  =  perm_out_aa(x1, x2)
U3_aa(x1, x2, x3, x4)  =  U3_aa(x4)
U4_aa(x1, x2, x3, x4, x5, x6)  =  U4_aa(x1, x6)
U5_aa(x1, x2, x3, x4)  =  U5_aa(x1, x4)
U4_AA(x1, x2, x3, x4, x5, x6)  =  U4_AA(x1, x6)
PERM_IN_AA(x1, x2)  =  PERM_IN_AA
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

U4_AA(Xs, X, Ys, X1s, X2s, ap2_out_gaa(X1s, X2s, Zs)) → PERM_IN_AA(Zs, Ys)
U3_AA(Xs, X, Ys, ap1_out_aga(X1s, cons(X, X2s), Xs)) → U4_AA(Xs, X, Ys, X1s, X2s, ap2_in_gaa(X1s, X2s, Zs))
PERM_IN_AA(Xs, cons(X, Ys)) → U3_AA(Xs, X, Ys, ap1_in_aga(X1s, cons(X, X2s), Xs))

The TRS R consists of the following rules:

ap2_in_gaa(nil, X, X) → ap2_out_gaa(nil, X, X)
ap2_in_gaa(cons(H, X), Y, cons(H, Z)) → U2_gaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
ap1_in_aga(nil, X, X) → ap1_out_aga(nil, X, X)
ap1_in_aga(cons(H, X), Y, cons(H, Z)) → U1_aga(H, X, Y, Z, ap1_in_aga(X, Y, Z))
U2_gaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_gaa(cons(H, X), Y, cons(H, Z))
U1_aga(H, X, Y, Z, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons(H, X), Y, cons(H, Z))
ap2_in_aaa(nil, X, X) → ap2_out_aaa(nil, X, X)
ap2_in_aaa(cons(H, X), Y, cons(H, Z)) → U2_aaa(H, X, Y, Z, ap2_in_aaa(X, Y, Z))
U2_aaa(H, X, Y, Z, ap2_out_aaa(X, Y, Z)) → ap2_out_aaa(cons(H, X), Y, cons(H, Z))

The argument filtering Pi contains the following mapping:
nil  =  nil
cons(x1, x2)  =  cons
ap1_in_aga(x1, x2, x3)  =  ap1_in_aga(x2)
ap1_out_aga(x1, x2, x3)  =  ap1_out_aga(x1, x2, x3)
U1_aga(x1, x2, x3, x4, x5)  =  U1_aga(x3, x5)
ap2_in_gaa(x1, x2, x3)  =  ap2_in_gaa(x1)
ap2_out_gaa(x1, x2, x3)  =  ap2_out_gaa(x1)
U2_gaa(x1, x2, x3, x4, x5)  =  U2_gaa(x5)
ap2_in_aaa(x1, x2, x3)  =  ap2_in_aaa
ap2_out_aaa(x1, x2, x3)  =  ap2_out_aaa(x1)
U2_aaa(x1, x2, x3, x4, x5)  =  U2_aaa(x5)
U4_AA(x1, x2, x3, x4, x5, x6)  =  U4_AA(x1, x6)
PERM_IN_AA(x1, x2)  =  PERM_IN_AA
U3_AA(x1, x2, x3, x4)  =  U3_AA(x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

U3_AA(ap1_out_aga(X1s, cons, Xs)) → U4_AA(Xs, ap2_in_gaa(X1s))
U4_AA(Xs, ap2_out_gaa(X1s)) → PERM_IN_AA
PERM_IN_AAU3_AA(ap1_in_aga(cons))

The TRS R consists of the following rules:

ap2_in_gaa(nil) → ap2_out_gaa(nil)
ap2_in_gaa(cons) → U2_gaa(ap2_in_aaa)
ap1_in_aga(X) → ap1_out_aga(nil, X, X)
ap1_in_aga(Y) → U1_aga(Y, ap1_in_aga(Y))
U2_gaa(ap2_out_aaa(X)) → ap2_out_gaa(cons)
U1_aga(Y, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons, Y, cons)
ap2_in_aaaap2_out_aaa(nil)
ap2_in_aaaU2_aaa(ap2_in_aaa)
U2_aaa(ap2_out_aaa(X)) → ap2_out_aaa(cons)

The set Q consists of the following terms:

ap2_in_gaa(x0)
ap1_in_aga(x0)
U2_gaa(x0)
U1_aga(x0, x1)
ap2_in_aaa
U2_aaa(x0)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule U3_AA(ap1_out_aga(X1s, cons, Xs)) → U4_AA(Xs, ap2_in_gaa(X1s)) at position [1] we obtained the following new rules:

U3_AA(ap1_out_aga(nil, cons, y1)) → U4_AA(y1, ap2_out_gaa(nil))
U3_AA(ap1_out_aga(cons, cons, y1)) → U4_AA(y1, U2_gaa(ap2_in_aaa))



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
QDP
                            ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

U3_AA(ap1_out_aga(nil, cons, y1)) → U4_AA(y1, ap2_out_gaa(nil))
U4_AA(Xs, ap2_out_gaa(X1s)) → PERM_IN_AA
U3_AA(ap1_out_aga(cons, cons, y1)) → U4_AA(y1, U2_gaa(ap2_in_aaa))
PERM_IN_AAU3_AA(ap1_in_aga(cons))

The TRS R consists of the following rules:

ap2_in_gaa(nil) → ap2_out_gaa(nil)
ap2_in_gaa(cons) → U2_gaa(ap2_in_aaa)
ap1_in_aga(X) → ap1_out_aga(nil, X, X)
ap1_in_aga(Y) → U1_aga(Y, ap1_in_aga(Y))
U2_gaa(ap2_out_aaa(X)) → ap2_out_gaa(cons)
U1_aga(Y, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons, Y, cons)
ap2_in_aaaap2_out_aaa(nil)
ap2_in_aaaU2_aaa(ap2_in_aaa)
U2_aaa(ap2_out_aaa(X)) → ap2_out_aaa(cons)

The set Q consists of the following terms:

ap2_in_gaa(x0)
ap1_in_aga(x0)
U2_gaa(x0)
U1_aga(x0, x1)
ap2_in_aaa
U2_aaa(x0)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ UsableRulesProof
QDP
                                ↳ QReductionProof

Q DP problem:
The TRS P consists of the following rules:

U3_AA(ap1_out_aga(nil, cons, y1)) → U4_AA(y1, ap2_out_gaa(nil))
U4_AA(Xs, ap2_out_gaa(X1s)) → PERM_IN_AA
U3_AA(ap1_out_aga(cons, cons, y1)) → U4_AA(y1, U2_gaa(ap2_in_aaa))
PERM_IN_AAU3_AA(ap1_in_aga(cons))

The TRS R consists of the following rules:

ap1_in_aga(X) → ap1_out_aga(nil, X, X)
ap1_in_aga(Y) → U1_aga(Y, ap1_in_aga(Y))
U1_aga(Y, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons, Y, cons)
ap2_in_aaaap2_out_aaa(nil)
ap2_in_aaaU2_aaa(ap2_in_aaa)
U2_gaa(ap2_out_aaa(X)) → ap2_out_gaa(cons)
U2_aaa(ap2_out_aaa(X)) → ap2_out_aaa(cons)

The set Q consists of the following terms:

ap2_in_gaa(x0)
ap1_in_aga(x0)
U2_gaa(x0)
U1_aga(x0, x1)
ap2_in_aaa
U2_aaa(x0)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

ap2_in_gaa(x0)



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ UsableRulesProof
                              ↳ QDP
                                ↳ QReductionProof
QDP
                                    ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

U3_AA(ap1_out_aga(nil, cons, y1)) → U4_AA(y1, ap2_out_gaa(nil))
U4_AA(Xs, ap2_out_gaa(X1s)) → PERM_IN_AA
U3_AA(ap1_out_aga(cons, cons, y1)) → U4_AA(y1, U2_gaa(ap2_in_aaa))
PERM_IN_AAU3_AA(ap1_in_aga(cons))

The TRS R consists of the following rules:

ap1_in_aga(X) → ap1_out_aga(nil, X, X)
ap1_in_aga(Y) → U1_aga(Y, ap1_in_aga(Y))
U1_aga(Y, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons, Y, cons)
ap2_in_aaaap2_out_aaa(nil)
ap2_in_aaaU2_aaa(ap2_in_aaa)
U2_gaa(ap2_out_aaa(X)) → ap2_out_gaa(cons)
U2_aaa(ap2_out_aaa(X)) → ap2_out_aaa(cons)

The set Q consists of the following terms:

ap1_in_aga(x0)
U2_gaa(x0)
U1_aga(x0, x1)
ap2_in_aaa
U2_aaa(x0)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule PERM_IN_AAU3_AA(ap1_in_aga(cons)) at position [0] we obtained the following new rules:

PERM_IN_AAU3_AA(ap1_out_aga(nil, cons, cons))
PERM_IN_AAU3_AA(U1_aga(cons, ap1_in_aga(cons)))



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ UsableRulesProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
QDP
                                        ↳ NonTerminationProof

Q DP problem:
The TRS P consists of the following rules:

U3_AA(ap1_out_aga(nil, cons, y1)) → U4_AA(y1, ap2_out_gaa(nil))
U4_AA(Xs, ap2_out_gaa(X1s)) → PERM_IN_AA
PERM_IN_AAU3_AA(ap1_out_aga(nil, cons, cons))
U3_AA(ap1_out_aga(cons, cons, y1)) → U4_AA(y1, U2_gaa(ap2_in_aaa))
PERM_IN_AAU3_AA(U1_aga(cons, ap1_in_aga(cons)))

The TRS R consists of the following rules:

ap1_in_aga(X) → ap1_out_aga(nil, X, X)
ap1_in_aga(Y) → U1_aga(Y, ap1_in_aga(Y))
U1_aga(Y, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons, Y, cons)
ap2_in_aaaap2_out_aaa(nil)
ap2_in_aaaU2_aaa(ap2_in_aaa)
U2_gaa(ap2_out_aaa(X)) → ap2_out_gaa(cons)
U2_aaa(ap2_out_aaa(X)) → ap2_out_aaa(cons)

The set Q consists of the following terms:

ap1_in_aga(x0)
U2_gaa(x0)
U1_aga(x0, x1)
ap2_in_aaa
U2_aaa(x0)

We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

The TRS P consists of the following rules:

U3_AA(ap1_out_aga(nil, cons, y1)) → U4_AA(y1, ap2_out_gaa(nil))
U4_AA(Xs, ap2_out_gaa(X1s)) → PERM_IN_AA
PERM_IN_AAU3_AA(ap1_out_aga(nil, cons, cons))
U3_AA(ap1_out_aga(cons, cons, y1)) → U4_AA(y1, U2_gaa(ap2_in_aaa))
PERM_IN_AAU3_AA(U1_aga(cons, ap1_in_aga(cons)))

The TRS R consists of the following rules:

ap1_in_aga(X) → ap1_out_aga(nil, X, X)
ap1_in_aga(Y) → U1_aga(Y, ap1_in_aga(Y))
U1_aga(Y, ap1_out_aga(X, Y, Z)) → ap1_out_aga(cons, Y, cons)
ap2_in_aaaap2_out_aaa(nil)
ap2_in_aaaU2_aaa(ap2_in_aaa)
U2_gaa(ap2_out_aaa(X)) → ap2_out_gaa(cons)
U2_aaa(ap2_out_aaa(X)) → ap2_out_aaa(cons)


s = U4_AA(Xs, ap2_out_gaa(X1s)) evaluates to t =U4_AA(cons, ap2_out_gaa(nil))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

U4_AA(Xs, ap2_out_gaa(X1s))PERM_IN_AA
with rule U4_AA(Xs', ap2_out_gaa(X1s')) → PERM_IN_AA at position [] and matcher [X1s' / X1s, Xs' / Xs]

PERM_IN_AAU3_AA(ap1_out_aga(nil, cons, cons))
with rule PERM_IN_AAU3_AA(ap1_out_aga(nil, cons, cons)) at position [] and matcher [ ]

U3_AA(ap1_out_aga(nil, cons, cons))U4_AA(cons, ap2_out_gaa(nil))
with rule U3_AA(ap1_out_aga(nil, cons, y1)) → U4_AA(y1, ap2_out_gaa(nil))

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.